Skip to content

Skip tests that require Windows admin instead of fail#4757

Merged
Kielek merged 2 commits intoopen-telemetry:mainfrom
martincostello:skip-admin-tests
Jan 15, 2026
Merged

Skip tests that require Windows admin instead of fail#4757
Kielek merged 2 commits intoopen-telemetry:mainfrom
martincostello:skip-admin-tests

Conversation

@martincostello
Copy link
Member

Why

Improves local development experience.

What

Skip tests that require Windows admin permissions, rather than fail.

Tests

None.

Checklist

  • CHANGELOG.md is updated.
  • Documentation is updated.
  • New features are covered by tests.

@martincostello
Copy link
Member Author

Failures look like unrelated flakes.

@martincostello martincostello marked this pull request as ready for review January 13, 2026 16:03
@martincostello martincostello requested a review from a team as a code owner January 13, 2026 16:03
Copilot AI review requested due to automatic review settings January 13, 2026 16:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the local development experience by skipping tests that require Windows administrator privileges instead of failing them. It introduces two new custom xUnit attributes (WindowsAdministratorFactAttribute and WindowsAdministratorTheoryAttribute) that automatically check for Windows admin privileges and skip tests when they are not available.

Changes:

  • Created two new custom test attributes for xUnit that check Windows admin privileges and skip tests automatically
  • Replaced [Fact] and [Theory] attributes with the new custom attributes in tests requiring admin privileges
  • Removed redundant Assert.True(EnvironmentTools.IsWindowsAdministrator(), ...) calls from test methods

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WindowsAdministratorTheoryAttribute.cs New custom attribute for theory tests requiring Windows admin privileges
WindowsAdministratorFactAttribute.cs New custom attribute for fact tests requiring Windows admin privileges
WcfNetFrameworkTests.cs Applied WindowsAdministratorFact attribute to test requiring admin privileges
WcfIISTests.cs Applied WindowsAdministratorFact attribute and removed redundant assertion
WcfDotNetTests.cs Applied WindowsAdministratorTheory attribute to parameterized test
OwinIISTests.cs Applied WindowsAdministratorFact attribute and removed redundant assertions from two tests
DomainNeutralTests.cs Applied WindowsAdministratorFact attribute and removed redundant assertion
AspNetTests.cs Applied WindowsAdministratorTheory/Fact attributes and removed redundant assertions from four tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Skip tests that require Windows admin permissions, rather than fail.
Require administrator if on Windows, rather than require administrator and Windows.
@Kielek Kielek enabled auto-merge (squash) January 15, 2026 10:15
@Kielek Kielek merged commit 45a3b23 into open-telemetry:main Jan 15, 2026
51 checks passed
@martincostello martincostello deleted the skip-admin-tests branch January 15, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments